package demo1;
abstract class Animal {
    public String name;
    public int age;
//    public Animal() {
//
//    }
    public Animal(String name,int age) {
        this.name = name;
        this.age = age;
    }

    //抽象方法
    public abstract void eat();
}
class Dog extends Animal {
//    public Dog() {
//        super("小太阳",10);
//    }
    public Dog(String name, int age){
        super(name,age);
    }
    @Override
    public void eat() {
        System.out.println(name + " 吃狗粮！");
    }
}
public class Test {
    public static void main(String[] args) {
        //Animal animal = new Animal();
        Dog dog = new Dog("小于",10);
    }
}
